package com.lims.landInfo.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javacommon.base.*;


/**
 * @author zzh
 * @version 1.0
 * @since 1.0
 */
@Entity
@Table(name = "LIMS_CorpAff")
public class Corpaff extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//columns START
    /**
     * objid       db_column: OBJID 
     */ 	
	private java.lang.String objid;
    /**
     * sno       db_column: SNO 
     */ 	
	private Integer sno;
    /**
     * corpno       db_column: CORPNO 
     */ 	
	private java.lang.String corpno;
    /**
     * name       db_column: NAME 
     */ 	
	private java.lang.String name;
    /**
     * parentno       db_column: PARENTNO 
     */ 	
	private java.lang.String parentno;
    /**
     * parentname       db_column: PARENTNAME 
     */ 	
	private java.lang.String parentname;
    /**
     * treeno       db_column: TREENO 
     */ 	
	private java.lang.String treeno;
	//columns END


	public Corpaff(){
	}

	public Corpaff(java.lang.String objid) {
		this.objid = objid;
	}

	public void setObjid(java.lang.String value) {
		this.objid = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid") //unique = true,
	@Column(name = "OBJID",nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getObjid() {
		return this.objid;
	}
	
	@Column(name = "SNO", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public Integer getSno() {
		return this.sno;
	}
	
	public void setSno(Integer value) {
		this.sno = value;
	}
	
	@Column(name = "CORPNO", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getCorpno() {
		return this.corpno;
	}
	
	public void setCorpno(java.lang.String value) {
		this.corpno = value;
	}
	
	@Column(name = "NAME", unique = false, nullable = true, insertable = true, updatable = true, length = 150)
	public java.lang.String getName() {
		return this.name;
	}
	
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	@Column(name = "PARENTNO", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getParentno() {
		return this.parentno;
	}
	
	public void setParentno(java.lang.String value) {
		this.parentno = value;
	}
	
	@Column(name = "PARENTNAME", unique = false, nullable = true, insertable = true, updatable = true, length = 150)
	public java.lang.String getParentname() {
		return this.parentname;
	}
	
	public void setParentname(java.lang.String value) {
		this.parentname = value;
	}
	
	@Column(name = "TREENO", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	public java.lang.String getTreeno() {
		return this.treeno;
	}
	
	public void setTreeno(java.lang.String value) {
		this.treeno = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Objid",getObjid())
			.append("Sno",getSno())
			.append("Corpno",getCorpno())
			.append("Name",getName())
			.append("Parentno",getParentno())
			.append("Parentname",getParentname())
			.append("Treeno",getTreeno())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getObjid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Corpaff == false) return false;
		if(this == obj) return true;
		Corpaff other = (Corpaff)obj;
		return new EqualsBuilder()
			.append(getObjid(),other.getObjid())
			.isEquals();
	}
}

